<%--
  Created by IntelliJ IDEA.
  User: 18383
  Date: 2023/3/10
  Time: 11:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<html>
<head>
    <title></title>
    <link rel="stylesheet" href="../static/plugins/bootstrap-3.4.1/css/bootstrap.min.css">
    <style>
        th, td {
            text-align: center;
            font-size: 14px;
        }
        .status {
            color: #5eb95e;
        }

    </style>
</head>
<body>
<jsp:include page="../layout/manage_nav.jsp"></jsp:include>
<div class="container">
    <div class="panel panel-primary">
        <!-- Default panel contents -->
        <div class="panel-heading" style="font-weight: bold">订单列表</div>

        <!-- Table -->
        <table class="table table-hover">
            <thead>
            <tr>
                <th>订单号</th>
                <th>书名</th>
                <th>用户名</th>
                <th>购买数量</th>
                <th>付款金额</th>
                <th>订单状态</th>
                <th>下单时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items='${requestScope.list}' var="item" varStatus="loop">
                <tr>
                    <td>${item.order_id}</td>
                    <td>${requestScope.book_name.get(loop.count-1)}</td>
                    <td>${requestScope.user_name.get(loop.count-1)}</td>
                    <td>x${item.buy_num}</td>
                    <td class="text-muted">
                        <span>￥</span>
                        <span>${item.price}</span>
                    </td>
                    <td class="status">${item.statue}</td>
                    <td><span>${fn:substring(item.create_time, 0, 19)}</span></td>
                    <td>
                        <a href="/admin?m=deleteOrder&oid=${item.order_id}" class="btn btn-danger btn-xs">
                            <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
                            删除
                        </a>
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>
</div>

<script src="../static/js/jquery-3.6.3.min.js"></script>
<script src="../static/plugins/bootstrap-3.4.1/js/bootstrap.min.js"></script>
</body>
</html>
